//之后的算法都用泛型和迭代器实现，别jb偷懒再用int了
//下次一定先设计再写代码，不然哪个变量干嘛的都找不对
//思路就不留着回忆了，就单总结一下收获
//核心就是项目要求的方法，用排序的方法解决问题
//然后就是上面的关于项目的收获
//语法方面，记住了关于java比较器的写法还有就是关于容器的使用
//大致就是这些
import java.util.LinkedList;
import java.util.Scanner;
public class FastCollinearPoints {
    public FastCollinearPoints(Point[] points)     // finds all line segments containing 4 or more points
    {
        this.a=new LinkedList<LineSegment>();
       double[] slope=new double[points.length];   //储存斜率的数组,但是后来会进行排序
       double[] slope_copy=new double[points.length];   //储存斜率的数组
       for(int i=0;i<points.length;i++)       //对每个点p 与其他点的斜率进行排序 这个循环是对每个点p进行的循环
       {
        for(int j=0;j<points.length;j++)
        {
          slope[j]=points[i].slopeTo(points[j]);
          slope_copy[j]=slope[j];
        }
        MergeSort sort=new MergeSort();
        sort.MySort(slope);
        int max=1,times=1;double f=slope[1],max_pt_slope=slope[1];//排完后slope的第零位是代表自己那个
        for(int j=2;j<points.length;j++)
        {
         if(f==slope[j])
         {
            times++;
            if(times>max)
            {
                max=times;
                max_pt_slope=f;
            }
         }   
         else
         {
            f=slope[j];
            times=1;
         }
        }
        if(max>=3)   //说明找到了一条 
        {
            Point a[]=new Point[max+1];
            int a_circle=0;
            for(int j=0;j<points.length;j++)
            {
              if(slope_copy[j]==max_pt_slope)
              {
                a[a_circle]=points[j];
                a_circle++;
              }
            }
            a[max]=points[i];
            InsertionSort sort_c=new InsertionSort();
            sort_c.MySort(a);
            LineSegment newone=new LineSegment(a[0],a[a.length-1]);
            if(!this.a.contains(newone))
            {
            this.a.addFirst(newone);
            numberOfSegments++;
            }
        }
       }
    }
    private int numberOfSegments;
   public           int numberOfSegments()        // the number of line segments
   {
    return numberOfSegments;
   }

   private LinkedList<LineSegment> a;
   public LineSegment[] segments()                // the line segments
   {
    LineSegment[] segments=new LineSegment[numberOfSegments];
    int i=0;
    while(a.size()!=0)
    {
       segments[i]=a.removeFirst();
       i++;
    }
    return segments;
   }
    
   public static void main(String[] args) {

    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    Point[] points = new Point[n];
    for (int i = 0; i < n; i++) {
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        points[i] = new Point(x, y);
    }

    // FastCollinearPoints collinear = new FastCollinearPoints(points);
    FastCollinearPoints Collinear=new  FastCollinearPoints(points);
    for (LineSegment segment : Collinear.segments()) {
        System.out.println(segment);
    }
}
}
